package edu.uestc.gene.ui.view;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

import edu.uestc.gene.ui.util.ShellUtil;

public class ConfigComposite extends Composite {

	protected Label dg_label, da_label, space;
	protected Text dg_text, da_text, gene1_text, gene2_text;
	protected Button dg_button, da_button, index, statistics, help;

	public ConfigComposite(Composite parent, int style) {
		super(parent, style);
		config();
		draw();
	}

	private void config() {
		setLayout(new GridLayout(8, true));
	}

	public void draw() {
		/************* line 1 ***************/
		dg_label = new Label(this, 0);
		dg_label.setText("读入D-G表");
		dg_label.setLayoutData(ShellUtil.getData1(3, 1));

		da_label = new Label(this, 0);
		da_label.setText("读入D-A表");
		da_label.setLayoutData(ShellUtil.getData1(5, 1));

		/************* line 2 ***************/
		dg_text = new Text(this, SWT.BORDER | SWT.READ_ONLY);
		dg_text.setText("点击浏览录入D-G数据表");
		dg_text.setLayoutData(ShellUtil.getData1(2, 1));

		dg_button = new Button(this, SWT.PUSH);
		dg_button.setText("浏览");
		dg_button.setLayoutData(ShellUtil.getData3(1, 1));

		da_text = new Text(this, SWT.BORDER | SWT.READ_ONLY);
		da_text.setText("点击浏览录入D-A数据表");
		da_text.setLayoutData(ShellUtil.getData1(2, 1));

		da_button = new Button(this, SWT.PUSH);
		da_button.setText("浏览");
		da_button.setLayoutData(ShellUtil.getData3(1, 1));

		space = new Label(this, 0);
		space.setLayoutData(ShellUtil.getData1(1, 1));

		help = new Button(this, SWT.PUSH);
		help.setText("使用说明");

		/************* line 3 ***************/
		index = new Button(this, SWT.PUSH);
		index.setText("索引数据文件");
		index.setLayoutData(ShellUtil.getData1(1, 1));

		space = new Label(this, 0);
		space.setLayoutData(ShellUtil.getData1(2, 1));

		gene1_text = new Text(this, SWT.BORDER);
		gene1_text.setText("输入第一个基因");

		gene2_text = new Text(this, SWT.BORDER);
		gene2_text.setText("输入第二个基因");

		statistics = new Button(this, SWT.PUSH);
		statistics.setText("统计");
		statistics.setEnabled(false);
		statistics.setLayoutData(ShellUtil.getData1(1, 1));
	}

	@Override
	protected void checkSubclass() {
	}

}
